 /* Copyright 2018 JDCLOUD.COM

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http:#www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

京东云数据库MongoDB接口
数据库MongoDB相关接口

OpenAPI spec version: v1
Contact: 

NOTE: This class is auto generated by the jdcloud code generator program.
*/


#import <Foundation/Foundation.h>
#import <JDCloudOCSDKMongodb/MongodbExecutor.h>

@implementation MongodbClient

@synthesize userAgent = _userAgent;
@synthesize serviceName = _serviceName;
@synthesize version = _version;

-(void) addCustomerHeaderWithKey:(NSString*) key
                           value:(NSString*) value{
    if(![self customHeader])
    {
        self.customHeader = [[NSMutableDictionary alloc] init];
    }
    if(key && value)
    {
        [[self customHeader] setValue:value forKey:key];
    }
   
}

-(id)initWithGlobalConfig{
    if(![GlobalConfig credential])
    {
        NSException *e = [SDKArgumentNullException exceptionWithName:@"ArgumentNullException" reason:@"GlobalConfig credential not config" userInfo:nil];
        @throw e;
    }
    self.credential = [GlobalConfig credential];
    if(![GlobalConfig sdkEnvironment])
    {
        self.sdkEnvironment = [[SDKEnvironment alloc] initWithEndPoint:@"mongodb.jdcloud-api.com"];
    }else
    {
        self.sdkEnvironment = [GlobalConfig sdkEnvironment];
    }
    self.httpRequestProtocol = @"https";
    _userAgent = @"JdCloudOCSdk 0.0.1 mongodb  v1";
    _serviceName = @"mongodb";
    _version = @"v1";
    self.contentType = @"application/json";
    return self;
}

-(id)initWithCredential:(Credential*)credential
         sdkEnvironment:(SDKEnvironment*)sdkEnvironment
{
    if(!credential)
    {
        NSException *e = [SDKArgumentNullException exceptionWithName:@"ArgumentNullException" reason:@" credential can not null" userInfo:nil];
        @throw e;
    }else{
        self.credential = credential;
    }
    
    if(!sdkEnvironment)
    {
        NSException *e = [SDKArgumentNullException exceptionWithName:@"ArgumentNullException" reason:@" sdkEnvironment can not null" userInfo:nil];
        @throw e;
    }else{
        self.sdkEnvironment = sdkEnvironment;
    }
    self.httpRequestProtocol = @"https";
    _userAgent = @"JdCloudOCSdk 0.0.1 mongodb  v1";
    _serviceName = @"mongodb";
    _version = @"v1";
    self.contentType = @"application/json";
    return self;
}

-(id)initWithCredential:(Credential*)credential
{
    if(!credential)
    {
        NSException *e = [SDKArgumentNullException exceptionWithName:@"ArgumentNullException" reason:@" credential can not null" userInfo:nil];
        @throw e;
    }else{
        self.credential = credential;
    }
    if(![GlobalConfig sdkEnvironment])
    {
        self.sdkEnvironment = [[SDKEnvironment alloc] initWithEndPoint:@"mongodb.jdcloud-api.com"];
    }else
    {
        self.sdkEnvironment = [GlobalConfig sdkEnvironment];
    }
    self.httpRequestProtocol = @"https";
    _userAgent = @"JdCloudOCSdk 0.0.1 mongodb  v1";
    _serviceName = @"mongodb";
    _version = @"v1";
    self.contentType = @"application/json";
    return self;
}

-(id)init{
    self.httpRequestProtocol = @"https";
    _userAgent = @"JdCloudOCSdk 0.0.1 mongodb  v1";
    _serviceName = @"mongodb";
    _version = @"v1";
    self.contentType = @"application/json";
    return self;
}


/**
modifyInstanceSpec sync request
@param modifyInstanceSpecRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `modifyInstanceSpecResponse` the request response data model
*/
-(NSDictionary*) modifyInstanceSpecSyncWithRequest:(MongodbModifyInstanceSpecRequest*) modifyInstanceSpecRequest
{
MongodbModifyInstanceSpecExecutor* excutor = [[MongodbModifyInstanceSpecExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:modifyInstanceSpecRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    MongodbModifyInstanceSpecResponse* response = [[MongodbModifyInstanceSpecResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"modifyInstanceSpecResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)modifyInstanceSpecAsyncWithRequest:(MongodbModifyInstanceSpecRequest*) modifyInstanceSpecRequest
                       completionHandler:(void(^)(int statusCode,MongodbModifyInstanceSpecResponse* _Nullable modifyInstanceSpecResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
MongodbModifyInstanceSpecExecutor* excutor = [[MongodbModifyInstanceSpecExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:modifyInstanceSpecRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    MongodbModifyInstanceSpecResponse* response = [[MongodbModifyInstanceSpecResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
createInstance sync request
@param createInstanceRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `createInstanceResponse` the request response data model
*/
-(NSDictionary*) createInstanceSyncWithRequest:(MongodbCreateInstanceRequest*) createInstanceRequest
{
MongodbCreateInstanceExecutor* excutor = [[MongodbCreateInstanceExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:createInstanceRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    MongodbCreateInstanceResponse* response = [[MongodbCreateInstanceResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"createInstanceResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)createInstanceAsyncWithRequest:(MongodbCreateInstanceRequest*) createInstanceRequest
                       completionHandler:(void(^)(int statusCode,MongodbCreateInstanceResponse* _Nullable createInstanceResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
MongodbCreateInstanceExecutor* excutor = [[MongodbCreateInstanceExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:createInstanceRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    MongodbCreateInstanceResponse* response = [[MongodbCreateInstanceResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
describeBackupPolicy sync request
@param describeBackupPolicyRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `describeBackupPolicyResponse` the request response data model
*/
-(NSDictionary*) describeBackupPolicySyncWithRequest:(MongodbDescribeBackupPolicyRequest*) describeBackupPolicyRequest
{
MongodbDescribeBackupPolicyExecutor* excutor = [[MongodbDescribeBackupPolicyExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:describeBackupPolicyRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    MongodbDescribeBackupPolicyResponse* response = [[MongodbDescribeBackupPolicyResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"describeBackupPolicyResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)describeBackupPolicyAsyncWithRequest:(MongodbDescribeBackupPolicyRequest*) describeBackupPolicyRequest
                       completionHandler:(void(^)(int statusCode,MongodbDescribeBackupPolicyResponse* _Nullable describeBackupPolicyResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
MongodbDescribeBackupPolicyExecutor* excutor = [[MongodbDescribeBackupPolicyExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:describeBackupPolicyRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    MongodbDescribeBackupPolicyResponse* response = [[MongodbDescribeBackupPolicyResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
describeSecurityIps sync request
@param describeSecurityIpsRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `describeSecurityIpsResponse` the request response data model
*/
-(NSDictionary*) describeSecurityIpsSyncWithRequest:(MongodbDescribeSecurityIpsRequest*) describeSecurityIpsRequest
{
MongodbDescribeSecurityIpsExecutor* excutor = [[MongodbDescribeSecurityIpsExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:describeSecurityIpsRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    MongodbDescribeSecurityIpsResponse* response = [[MongodbDescribeSecurityIpsResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"describeSecurityIpsResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)describeSecurityIpsAsyncWithRequest:(MongodbDescribeSecurityIpsRequest*) describeSecurityIpsRequest
                       completionHandler:(void(^)(int statusCode,MongodbDescribeSecurityIpsResponse* _Nullable describeSecurityIpsResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
MongodbDescribeSecurityIpsExecutor* excutor = [[MongodbDescribeSecurityIpsExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:describeSecurityIpsRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    MongodbDescribeSecurityIpsResponse* response = [[MongodbDescribeSecurityIpsResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
backupDownloadURL sync request
@param backupDownloadURLRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `backupDownloadURLResponse` the request response data model
*/
-(NSDictionary*) backupDownloadURLSyncWithRequest:(MongodbBackupDownloadURLRequest*) backupDownloadURLRequest
{
MongodbBackupDownloadURLExecutor* excutor = [[MongodbBackupDownloadURLExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:backupDownloadURLRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    MongodbBackupDownloadURLResponse* response = [[MongodbBackupDownloadURLResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"backupDownloadURLResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)backupDownloadURLAsyncWithRequest:(MongodbBackupDownloadURLRequest*) backupDownloadURLRequest
                       completionHandler:(void(^)(int statusCode,MongodbBackupDownloadURLResponse* _Nullable backupDownloadURLResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
MongodbBackupDownloadURLExecutor* excutor = [[MongodbBackupDownloadURLExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:backupDownloadURLRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    MongodbBackupDownloadURLResponse* response = [[MongodbBackupDownloadURLResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
describeInstances sync request
@param describeInstancesRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `describeInstancesResponse` the request response data model
*/
-(NSDictionary*) describeInstancesSyncWithRequest:(MongodbDescribeInstancesRequest*) describeInstancesRequest
{
MongodbDescribeInstancesExecutor* excutor = [[MongodbDescribeInstancesExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:describeInstancesRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    MongodbDescribeInstancesResponse* response = [[MongodbDescribeInstancesResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"describeInstancesResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)describeInstancesAsyncWithRequest:(MongodbDescribeInstancesRequest*) describeInstancesRequest
                       completionHandler:(void(^)(int statusCode,MongodbDescribeInstancesResponse* _Nullable describeInstancesResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
MongodbDescribeInstancesExecutor* excutor = [[MongodbDescribeInstancesExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:describeInstancesRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    MongodbDescribeInstancesResponse* response = [[MongodbDescribeInstancesResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
deleteInstance sync request
@param deleteInstanceRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `deleteInstanceResponse` the request response data model
*/
-(NSDictionary*) deleteInstanceSyncWithRequest:(MongodbDeleteInstanceRequest*) deleteInstanceRequest
{
MongodbDeleteInstanceExecutor* excutor = [[MongodbDeleteInstanceExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:deleteInstanceRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    MongodbDeleteInstanceResponse* response = [[MongodbDeleteInstanceResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"deleteInstanceResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)deleteInstanceAsyncWithRequest:(MongodbDeleteInstanceRequest*) deleteInstanceRequest
                       completionHandler:(void(^)(int statusCode,MongodbDeleteInstanceResponse* _Nullable deleteInstanceResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
MongodbDeleteInstanceExecutor* excutor = [[MongodbDeleteInstanceExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:deleteInstanceRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    MongodbDeleteInstanceResponse* response = [[MongodbDeleteInstanceResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
restoreInstance sync request
@param restoreInstanceRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `restoreInstanceResponse` the request response data model
*/
-(NSDictionary*) restoreInstanceSyncWithRequest:(MongodbRestoreInstanceRequest*) restoreInstanceRequest
{
MongodbRestoreInstanceExecutor* excutor = [[MongodbRestoreInstanceExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:restoreInstanceRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    MongodbRestoreInstanceResponse* response = [[MongodbRestoreInstanceResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"restoreInstanceResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)restoreInstanceAsyncWithRequest:(MongodbRestoreInstanceRequest*) restoreInstanceRequest
                       completionHandler:(void(^)(int statusCode,MongodbRestoreInstanceResponse* _Nullable restoreInstanceResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
MongodbRestoreInstanceExecutor* excutor = [[MongodbRestoreInstanceExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:restoreInstanceRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    MongodbRestoreInstanceResponse* response = [[MongodbRestoreInstanceResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
describeFlavors sync request
@param describeFlavorsRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `describeFlavorsResponse` the request response data model
*/
-(NSDictionary*) describeFlavorsSyncWithRequest:(MongodbDescribeFlavorsRequest*) describeFlavorsRequest
{
MongodbDescribeFlavorsExecutor* excutor = [[MongodbDescribeFlavorsExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:describeFlavorsRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    MongodbDescribeFlavorsResponse* response = [[MongodbDescribeFlavorsResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"describeFlavorsResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)describeFlavorsAsyncWithRequest:(MongodbDescribeFlavorsRequest*) describeFlavorsRequest
                       completionHandler:(void(^)(int statusCode,MongodbDescribeFlavorsResponse* _Nullable describeFlavorsResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
MongodbDescribeFlavorsExecutor* excutor = [[MongodbDescribeFlavorsExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:describeFlavorsRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    MongodbDescribeFlavorsResponse* response = [[MongodbDescribeFlavorsResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
resetPassword sync request
@param resetPasswordRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `resetPasswordResponse` the request response data model
*/
-(NSDictionary*) resetPasswordSyncWithRequest:(MongodbResetPasswordRequest*) resetPasswordRequest
{
MongodbResetPasswordExecutor* excutor = [[MongodbResetPasswordExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:resetPasswordRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    MongodbResetPasswordResponse* response = [[MongodbResetPasswordResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"resetPasswordResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)resetPasswordAsyncWithRequest:(MongodbResetPasswordRequest*) resetPasswordRequest
                       completionHandler:(void(^)(int statusCode,MongodbResetPasswordResponse* _Nullable resetPasswordResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
MongodbResetPasswordExecutor* excutor = [[MongodbResetPasswordExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:resetPasswordRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    MongodbResetPasswordResponse* response = [[MongodbResetPasswordResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
createBackup sync request
@param createBackupRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `createBackupResponse` the request response data model
*/
-(NSDictionary*) createBackupSyncWithRequest:(MongodbCreateBackupRequest*) createBackupRequest
{
MongodbCreateBackupExecutor* excutor = [[MongodbCreateBackupExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:createBackupRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    MongodbCreateBackupResponse* response = [[MongodbCreateBackupResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"createBackupResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)createBackupAsyncWithRequest:(MongodbCreateBackupRequest*) createBackupRequest
                       completionHandler:(void(^)(int statusCode,MongodbCreateBackupResponse* _Nullable createBackupResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
MongodbCreateBackupExecutor* excutor = [[MongodbCreateBackupExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:createBackupRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    MongodbCreateBackupResponse* response = [[MongodbCreateBackupResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
modifyBackupPolicy sync request
@param modifyBackupPolicyRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `modifyBackupPolicyResponse` the request response data model
*/
-(NSDictionary*) modifyBackupPolicySyncWithRequest:(MongodbModifyBackupPolicyRequest*) modifyBackupPolicyRequest
{
MongodbModifyBackupPolicyExecutor* excutor = [[MongodbModifyBackupPolicyExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:modifyBackupPolicyRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    MongodbModifyBackupPolicyResponse* response = [[MongodbModifyBackupPolicyResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"modifyBackupPolicyResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)modifyBackupPolicyAsyncWithRequest:(MongodbModifyBackupPolicyRequest*) modifyBackupPolicyRequest
                       completionHandler:(void(^)(int statusCode,MongodbModifyBackupPolicyResponse* _Nullable modifyBackupPolicyResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
MongodbModifyBackupPolicyExecutor* excutor = [[MongodbModifyBackupPolicyExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:modifyBackupPolicyRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    MongodbModifyBackupPolicyResponse* response = [[MongodbModifyBackupPolicyResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
modifyInstanceName sync request
@param modifyInstanceNameRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `modifyInstanceNameResponse` the request response data model
*/
-(NSDictionary*) modifyInstanceNameSyncWithRequest:(MongodbModifyInstanceNameRequest*) modifyInstanceNameRequest
{
MongodbModifyInstanceNameExecutor* excutor = [[MongodbModifyInstanceNameExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:modifyInstanceNameRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    MongodbModifyInstanceNameResponse* response = [[MongodbModifyInstanceNameResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"modifyInstanceNameResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)modifyInstanceNameAsyncWithRequest:(MongodbModifyInstanceNameRequest*) modifyInstanceNameRequest
                       completionHandler:(void(^)(int statusCode,MongodbModifyInstanceNameResponse* _Nullable modifyInstanceNameResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
MongodbModifyInstanceNameExecutor* excutor = [[MongodbModifyInstanceNameExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:modifyInstanceNameRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    MongodbModifyInstanceNameResponse* response = [[MongodbModifyInstanceNameResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
modifySecurityIps sync request
@param modifySecurityIpsRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `modifySecurityIpsResponse` the request response data model
*/
-(NSDictionary*) modifySecurityIpsSyncWithRequest:(MongodbModifySecurityIpsRequest*) modifySecurityIpsRequest
{
MongodbModifySecurityIpsExecutor* excutor = [[MongodbModifySecurityIpsExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:modifySecurityIpsRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    MongodbModifySecurityIpsResponse* response = [[MongodbModifySecurityIpsResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"modifySecurityIpsResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)modifySecurityIpsAsyncWithRequest:(MongodbModifySecurityIpsRequest*) modifySecurityIpsRequest
                       completionHandler:(void(^)(int statusCode,MongodbModifySecurityIpsResponse* _Nullable modifySecurityIpsResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
MongodbModifySecurityIpsExecutor* excutor = [[MongodbModifySecurityIpsExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:modifySecurityIpsRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    MongodbModifySecurityIpsResponse* response = [[MongodbModifySecurityIpsResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
describeAvailableZones sync request
@param describeAvailableZonesRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `describeAvailableZonesResponse` the request response data model
*/
-(NSDictionary*) describeAvailableZonesSyncWithRequest:(MongodbDescribeAvailableZonesRequest*) describeAvailableZonesRequest
{
MongodbDescribeAvailableZonesExecutor* excutor = [[MongodbDescribeAvailableZonesExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:describeAvailableZonesRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    MongodbDescribeAvailableZonesResponse* response = [[MongodbDescribeAvailableZonesResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"describeAvailableZonesResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)describeAvailableZonesAsyncWithRequest:(MongodbDescribeAvailableZonesRequest*) describeAvailableZonesRequest
                       completionHandler:(void(^)(int statusCode,MongodbDescribeAvailableZonesResponse* _Nullable describeAvailableZonesResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
MongodbDescribeAvailableZonesExecutor* excutor = [[MongodbDescribeAvailableZonesExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:describeAvailableZonesRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    MongodbDescribeAvailableZonesResponse* response = [[MongodbDescribeAvailableZonesResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
describeBackups sync request
@param describeBackupsRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `describeBackupsResponse` the request response data model
*/
-(NSDictionary*) describeBackupsSyncWithRequest:(MongodbDescribeBackupsRequest*) describeBackupsRequest
{
MongodbDescribeBackupsExecutor* excutor = [[MongodbDescribeBackupsExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:describeBackupsRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    MongodbDescribeBackupsResponse* response = [[MongodbDescribeBackupsResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"describeBackupsResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)describeBackupsAsyncWithRequest:(MongodbDescribeBackupsRequest*) describeBackupsRequest
                       completionHandler:(void(^)(int statusCode,MongodbDescribeBackupsResponse* _Nullable describeBackupsResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
MongodbDescribeBackupsExecutor* excutor = [[MongodbDescribeBackupsExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:describeBackupsRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    MongodbDescribeBackupsResponse* response = [[MongodbDescribeBackupsResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}

/**
deleteBackup sync request
@param deleteBackupRequest request param
@return key `statusCode` http request status code type is int
            `dataResult` the http request response data  type is NSData
            `requestError` the request error type is NSError
            `deleteBackupResponse` the request response data model
*/
-(NSDictionary*) deleteBackupSyncWithRequest:(MongodbDeleteBackupRequest*) deleteBackupRequest
{
MongodbDeleteBackupExecutor* excutor = [[MongodbDeleteBackupExecutor alloc] initWithJDCloudClient:self];
    NSDictionary* responseResult = [excutor executeSync:deleteBackupRequest];
    if(responseResult)
    {
        NSData * resultData = [[responseResult objectForKey:@"dataResult"] copy];
        if(resultData)
        {
            NSMutableDictionary* result = [[NSMutableDictionary alloc]initWithDictionary:responseResult];
            
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    MongodbDeleteBackupResponse* response = [[MongodbDeleteBackupResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        [result setValue:response forKey:@"deleteBackupResponse"];
                        return result;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
    }
    return responseResult;
}


-(void)deleteBackupAsyncWithRequest:(MongodbDeleteBackupRequest*) deleteBackupRequest
                       completionHandler:(void(^)(int statusCode,MongodbDeleteBackupResponse* _Nullable deleteBackupResponse, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
MongodbDeleteBackupExecutor* excutor = [[MongodbDeleteBackupExecutor alloc] initWithJDCloudClient:self];
    [excutor executeAsync:deleteBackupRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        if(!error&&responseData)
        {
            NSData * resultData = [responseData copy];
            NSError *jsonError;
            NSDictionary* allKeys = [NSJSONSerialization JSONObjectWithData:resultData options:0 error:&jsonError];
            if(!jsonError&& allKeys)
            {
                @try {
                    MongodbDeleteBackupResponse* response = [[MongodbDeleteBackupResponse alloc]initWithDic:allKeys];
                    if(response)
                    {
                        completionHandler(statusCode,response,responseData,error);
                        return;
                    }
                } @catch (NSException *exception) {
                    if([GlobalConfig isDebug]){
                        NSLog(@"json serialize response data error,info is %@",exception.reason);
                    }
                }
            }
        }
        completionHandler(statusCode,nil,responseData,error);
    }];
}


 /**
 mongodb common sync request
 @param  jdcloudDataRequest request param
 @return key `statusCode` http request status code type is int
             `dataResult` the http request response data  type is NSData
             `requestError` the request error type is NSError
 */
 -(NSDictionary*) mongodbCommonSyncWithRequest:(JDCloudDataRequest*) jdcloudDataRequest
                                                   url:(NSString*) url
                                                method:(NSString*) method{
    CommonExecutor* excutor = [[CommonExecutor alloc] initWithJDCloudClient:self url:url method:method];
    NSDictionary* responseResult = [excutor executeDataSync:jdcloudDataRequest];
    return responseResult;
}

-(void)mongodbCommonAsyncWithRequest:(JDCloudDataRequest*) jdcloudDataRequest
                                         url:(NSString*) url
                                      method:(NSString*) method
                           completionHandler:(void(^)(int statusCode, NSData* _Nullable responseData,NSError * _Nullable error))completionHandler
{
     CommonExecutor* excutor = [[CommonExecutor alloc] initWithJDCloudClient:self url:url method:method];
    
    [excutor executeDataAsync:jdcloudDataRequest completionHandler:^(int statusCode, NSData * _Nullable responseData, NSError * _Nullable error) {
        completionHandler(statusCode,responseData,error);
    }];
} 

@end
